package com.cosmocoder.monopoly.domain;


public class Player {
	long id;
	User user;
	Room room;
	
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	public boolean equals (Player other) {
		return this.getId() == other.getId();
	}
	
	@Override
	public boolean equals(Object other) {
		if(other == null) return false;
		if(!(other instanceof Player)) return false;
		return equals((Player) other);
	}
	
	@Override
	public int hashCode() {
		return Long.valueOf(getId()).hashCode();
	}
}
